package com.conan.spring5.factoryBean;

import com.conan.spring5.collectType.Course;
import org.springframework.beans.factory.FactoryBean;

/**
 * @version 加油！！！
 * @Description
 * @Author 谷藤新一GYC
 * @Date 2022/10/20 - 22:05
 */
public class MyBean implements FactoryBean<Course> {
    //定义返回Bean
    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCname("工厂");
        return course;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
   